#ifndef __COMPONENT_UDDER_H__
#define __COMPONENT_UDDER_H__

#include "Components/Component.hpp"
#include "Engine/MathUtils.hpp"
#include "Engine/Vector2.hpp"

#include "EasyMachine.hpp"

using namespace PocketSurvival::Engine;

namespace PocketSurvival
{

    struct ComponentCreature;
    struct ComponentMiner;
    struct ComponentPathfinding;
    struct ComponentHerdBehavior;

    class SubsystemTimeOfDay;
    class SubsystemGameInfo;

    struct ComponentUdder : public Component
    {
    protected:
        float m_milkRegenerationTime;
        float m_lastMilkingTime;

    public:
        ComponentCreature *componentCreature;
        ComponentHerdBehavior *herdBehavior = nullptr;

        SubsystemTimeOfDay *timeOfDay;
        SubsystemGameInfo *gameInfo;

        bool hasMilk();
        bool Milk(ComponentMiner *milker);

        virtual void load(const nlohmann::json &jsonData) override;
        virtual void save(nlohmann::json &jsonData) override;

        virtual const std::string &getName() const override;
        static const std::string &GetName();
    };
}

#endif
